import request from '../api/baseApi';
import qs from 'qs';
// <<<<<<< HEAD
// export const cartInfo = datas => {
//   let Info = '/cart?';
//   return request({
//     method: 'GET',
//     url: Info + 'pageNum=' + datas.pageNum + '&pageSize=' + datas.pageSize,
//     data: qs.stringify(datas)
// =======

// 获取当前用户购物车内容【分页！！！！！】
export const cartInfo = (datas) => {
  return request({
    method: 'GET',
    url: '/cart',
    params: datas
  });
};

export const addTocart = datas => {
  return request({
    method: 'POST',
    url: '/cart/add',
    data: qs.stringify(datas)
  });
};
export const DeleteGoods = datas => {
  return request({
    method: 'POST',
    url: '/cart/deleteById',
    data: qs.stringify(datas)
  });
};
export const ClearAll = () => {
  return request({
    method: 'POST',
    url: '/cart/clear'
  });
};
